
pkgname=dbus
pkgver=1.12.8
pkgrel=1
pkgdesc="Freedesktop.org message bus system"
url="https://www.freedesktop.org/wiki/Software/dbus/"
arch=('x86_64')
license=('GPL' 'custom')
depends=('expat' 'coreutils' 'filesystem' 'shadow') 
makedepends=('libx11' 'systemd' 'xmlto')
options=('!libtool')
source=("https://dbus.freedesktop.org/releases/dbus/dbus-${pkgver}.tar.gz"
        '30-dbus')
md5sums=('2764bf150e5aa8005b7bc0d6c388756a'
         '3314d727fa57fc443fce25b5cbeebbcc')

build() {
  cd dbus-${pkgver}
  
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --libexecdir=/usr/lib/dbus-1.0 --with-dbus-user=dbus \
      --with-system-pid-file=/run/dbus/pid \
      --with-system-socket=/run/dbus/system_bus_socket \
      --with-console-auth-dir=/run/console/ \
      --enable-inotify \
      --disable-verbose-mode --disable-static \
      --disable-tests --disable-asserts \
      --with-systemdsystemunitdir=/usr/lib/systemd/system \
      --enable-systemd
  make
}

package(){
  cd dbus-${pkgver}
  make DESTDIR=${pkgdir} install

  rm -rf ${pkgdir}/var/run

  install -Dm755 ../30-dbus ${pkgdir}/etc/X11/xinit/xinitrc.d/30-dbus
  install -Dm644 COPYING ${pkgdir}/usr/share/licenses/dbus/COPYING
}
